<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.global.js"></script>
</head>

<body>
    <div id="app">
        <ul>
            <!-- <li v-for="p in arr">{{p}}</li> -->
            <!-- <li v-for="p of arr">{{p}}</li> -->
            <li v-for="(p,index) of arr">{{index}}:{{p}}</li>
        </ul>
        <hr>
        <!-- <p v-for="value in person">{{value}}</p> -->
        <hr>
        <!-- <p v-for="(value,key) in person">{{key}}:{{value}}</p> -->
        <hr>
        <!-- <p v-for="(value,key,index) in person">{{index}}:{{key}}:{{value}}</p> -->
        <!-- <p v-for="(v,k,i) in person">{{i}}:{{k}}:{{v}}</p> -->

        <hr>
        <h3>完整显示</h3>
        <div v-for="(value,key) in person">
            <h3 v-if="key!=='hobbies'">{{value}}</h3>
            <ul v-else>
                <li v-for="item in value">{{item}}</li>
            </ul>
        </div>
        
    </div>

    <script>
        Vue.createApp({
            data() {
                return {
                    arr: ['张三疯', '尼古拉斯赵四', '大刀王五'],
                    person: {
                        name: "jack",
                        age: 18,
                        gender: "男",
                        hobbies: [
                            "女", "抽烟", "喝酒", "烫头"
                        ]
                    }
                }
            }
        }).mount("#app")
    </script>
</body>

</html>